

SConscript(['common/SConscript', 'store/SConscript', 'server/SConscript', 'client/SConscript'])

lib_sources = ['client/src/client.cpp','client/src/broker.cpp','common/src/packet.pb.cpp']



env = Environment()
env[ 'CCFLAGS' ] = '-g -fPIC -D_THREAD_SAFE -pthread'
env[ 'CPPPATH' ] = [ 'include','client/include', 'common/include/fecab', '../../../include', '/home/s/include', ]
env[ 'CPPFLAGS' ] = []
env[ 'OBJSUFFIX' ] = '.obj'
#env[ 'LDFLAGS' ] = '-static '
#env[ 'LINKFLAGS' ] = '-static  '
env[ 'LIBDIR' ] = '../../lib'
env[ 'LIBPATH' ] = [ 'lib','/home/s/lib','/home/s/lib/static', ]
env[ 'LIBS' ] = ['bocat_common','protobuf','boost_filesystem-mt', 'boost_system-mt', 'boost_thread-mt','z','crypto','pthread',]
#env[ 'STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME' ] = 1

# static library
env.StaticLibrary( 'lib/libfecab_client.a', lib_sources )

import os
arch = os.uname()[4]
if ('i386' == arch) :
	# shared library
	env.SharedLibrary( 'lib/libfecab_client.so', lib_sources, LINKFLAGS='-Wl,-E' )
	# '-static' can cause so user cannot catch exception from shared object
	#env.SharedLibrary( 'lib/libfecab_client.so', lib_sources, LINKFLAGS='-static' )
elif ('x86_64' == arch) :
	# shared library
	env.SharedLibrary( 'lib/libfecab_client.so', lib_sources, LINKFLAGS='-Wl,-E' )




